package com.whzykj.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;
import com.whzykj.jfinal.TableBind;

@TableBind(name="orderdetails",pk="details_id")
public class OrderDetails extends Model<OrderDetails>{
	private static final long serialVersionUID = 1L;
	public static final OrderDetails me=new OrderDetails();
	
	/****
	 * 查询订单下商品信息
	 * @param orderid
	 * @return
	 */
	public List<Record> getOrderDetail(String orderid){
		String sql=" SELECT g.APP_NAME,o.SALE_PRICE,o.SALE_NUM FROM orderdetails o,goodsinfo g WHERE o.GOODS_ID=g.GOODS_ID AND o.ORDER_ID=? ";
		return Db.find(sql, orderid);
	}
}
